/*
 * Vn100Device.cpp
 *
 *  Created on: Nov 2, 2012
 *      Author: mark
 */

#include "Vn100Device.h"

/**
 * Constants.
 */
const char* Vn100Device::COM_PORT = "//dev//ttyUSB0";
const int Vn100Device::BAUD_RATE = 57600;

/**
 * Constructor.
 */
Vn100Device::Vn100Device() {
	vn100_connect(&this->device, this->COM_PORT, this->BAUD_RATE);
}

/**
 * Destructor.
 */
Vn100Device::~Vn100Device() {
	vn100_disconnect(&this->device);
}

/**
 * Gets the current VN100 orentation.
 */
VnYpr Vn100Device::GetOrientation() {
	vn100_getYawPitchRoll(&this->device, & this->orientation);
	return this->orientation;
}
